www.gusucode.com > VC 3D弹道仿真程序源码文件-源码程序 > VC 3D弹道仿真程序源码文件-源码程序/code/MovingSimulate.cpp
//Download by http://www.NewXing.com #include "stdafx.h" #include "Simulation.h" #include "Bomb.h" #include "3DMODEL.h" double t_step = 0.01, now_time = 0.0 ; double t_start = 0.0, t_start_1 = 0.0, t_start_2 = 0.0; double a,c,d,e; const double PI = 3.1415926; const double RAD = 180./PI; void main() { C3DModel * p3DModel = new C3DModel; CBomb * pBomb = new CBomb; p3DModel->InitialInput( ); //初始投弹偏差设置 while( p3DModel->XS[15] >= 0.0 ) { pBomb->RecordData( p3DModel->XS ); //记录数据文件 p3DModel->CalTrajectory( ); now_time += t_step; } pBomb->RecordToFile( ); LPCTSTR lpCaption; char pDisplay[100] ; sprintf( pDisplay , "落地误差:%6.3f米\n飞行时间:%6.2f秒\n修正射程=%10.4f米\n侧偏=%6.2f米" , a,c,d,e ) ; lpCaption = "300mm火箭弹落点数据已经保存" ; MessageBox( NULL, pDisplay, lpCaption, MB_OK ); return ; }